package org.example;

import org.example.tool.ShapeTool;

import java.util.List;

public class ShapeEntity {
    private String path;
    private List<LandEntity> lands;
    private LogInterface log;


    public ShapeEntity(String path,LogInterface  log) {
        this.path = path;
        //读取shape文件
        try {
            lands = ShapeTool.readShapeFile(path);
            log.logSuccess("读取shape文件成功，读取到"+lands.size()+"条数据");
        }catch (Exception e){
            e.printStackTrace();
            log.logError("读取shape文件失败");
        }
    }


    public List<LandEntity> getLands() {
        return lands;
    }
}
